package com.ruubypay.web.core.shiro.filter;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.web.filter.PathMatchingFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

/**
 * Desc : 过滤器
 * @author sucyun 
 * Date :2018/4/5 下午5:08
 */
public class SysUserFilter extends PathMatchingFilter {

    private Logger logger = LoggerFactory.getLogger(SysUserFilter.class);


    @Override
    protected boolean onPreHandle(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
        logger.debug("SysUserFilter----处理拦截URL："+httpServletRequest.getRequestURI());
        String username = (String) SecurityUtils.getSubject().getPrincipal();
        return true;
    }
}
